<?php
class FotopreviewsController extends AppController {

	var $name = 'Fotopreviews';

	function show($hash = null) {
                if ($hash) {
			$img = $this->Fotopreview->getFoto($hash);
			if($img) {
				header('Content-type: ' . $img['Fotopreview']['type']);
				//header('Content-length: ' . $img['Fotopreview']['size']);
				//header('Content-Disposition: attachment; filename='.$img['Fotopreview']['name']);
				echo $img['Fotopreview']['content'];
			}
		}
	}

}
?>
